propsage.namespace("prestige.admin.users");

prestige.admin.users.adjustScore = (function($, ui){
	 
	
	function initComponents()
	{
	
	}

	function initEventHandlers()
	{
		$('#submit-button').click(onSubmitClick)
	}
	
	function onSubmitClick()
	{
		if($('#ScoreAdjustment_amount').val() == 0  ){
			alert('Please enter an amount greater or less than 0');
			$('#ScoreAdjustment_amount').focus();
			return false;
		}
		
		if(isNaN($('#ScoreAdjustment_amount').val())){
			alert('The amount must be a number');
			$('#ScoreAdjustment_amount').focus();
			return false;
		}
		
		if($('#ScoreAdjustment_criteria_type_code').val() === ''  ){
			alert('Please enter a type of statistic or score to adjust');
			$('#ScoreAdjustment_criteria_type_code').focus();
			return false;
		}
		
		if($('#ScoreAdjustment_adjustment_effect_time').val() === ''  ){
			alert('Please enter the time this adjustment will take effect');
			$('#ScoreAdjustment_adjustment_effect_time').focus();
			return false;
		}
		
		$('#add-adjustment-form').submit();
	}
	
	$(document).ready(function(){
		initComponents();
		initEventHandlers();
	});
	
}(jQuery, propsage.ui));